package com.shengyin.ec.model.dao.account;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.shengyin.ec.model.dao.BaseDao;
import com.shengyin.ec.model.dao.BaseDaoImpl;
import com.shengyin.ec.model.entity.District;

@Repository("districtDao")
public class DistrictDaoImpl extends BaseDaoImpl<District> implements DistrictDao {
	
	@Override
	public List<District> getDistrictListByCityId(int id){
		//List<District> listDistrict = super.find();
		List<District> listDistrict = super.find("from District d where d.parentCityId='"+id+"'");
		for(int i = 0; i < listDistrict.size(); i++)
			System.out.println(listDistrict.get(i).getDistrictName());
		return listDistrict;
	}
}